﻿IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'GetOrdenCompraByIdOrdenCompra')
	BEGIN
		DROP  Procedure  GetOrdenCompraByIdOrdenCompra
	END

GO

CREATE Procedure GetOrdenCompraByIdOrdenCompra
	@idOrdenCompra int
AS
BEGIN

	SET NOCOUNT ON
	
	SELECT
	OC.[Descripcion],
	OC.[Estado],
	OC.[FechaCompra],
	OC.[IdEmpleado],
	OC.[IdOrdenCompra],
	OC.[IdOrdenPedido],
	OC.[IdProveedor]
	FROM [OrdenCompra] AS OC
	WHERE OC.[IdOrdenCompra]=@idOrdenCompra 

	SET NOCOUNT OFF
END


GO


GRANT EXEC ON GetOrdenCompraByIdOrdenCompra TO PUBLIC

GO


